package com.jinlia.show.modules.wxapp.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.web.client.RestTemplate;

import java.nio.charset.StandardCharsets;

@Configuration("wxappRestTemplateConfig")
public class RestTemplateConfig {
    @Bean(name = "dadaRestTemplate")
    public RestTemplate dadaRestTemplate() {
        RestTemplate dadaRestTemplate = new RestTemplate();
        dadaRestTemplate.getMessageConverters().set(1, new StringHttpMessageConverter(StandardCharsets.UTF_8));
        return dadaRestTemplate;
    }

    @Bean(name = "wxRestTemplate")
    public RestTemplate wxRestTemplate() {
        RestTemplate wxRestTemplate = new RestTemplate();
        wxRestTemplate.getMessageConverters().set(1, new StringHttpMessageConverter(StandardCharsets.UTF_8));
        return wxRestTemplate;
    }
}
